@extends('backend.layouts.app')

@section('content')
<div class="layui-card">
    <div class="layui-card-header layui-card-header-auto">
        {{$module->full_name}} -- 功能按钮
    </div>
    <div class="layui-card-body">
        <div class="layui-row" style="margin-bottom:10px">
            <div class="layui-col-md9">&nbsp;</div>
            <div class="layui-col-md3">
                <div class="layui-btn-group" style="float:right">
                    <a href="{{ route('admin.auth.module.button.create',['module_id' => $module->module_id]) }}"
                        class="layui-btn layui-btn-sm">添加</a>
                    <a href="{{route('admin.auth.module.index')}}" class="layui-btn layui-btn-sm">返回</a>
                </div>
            </div>
        </div>
        <table id="dataTable" lay-filter="dataTable"></table>
        <script type="text/html" id="options">
            <div class="layui-btn-group">
                <a class="layui-btn layui-btn-sm" lay-event="edit">编辑</a>
                <a class="layui-btn layui-btn-sm layui-btn-danger" lay-event="del">删除</a>
            </div>

        </script>
    </div>
</div>
@endsection

@section('script')
<script type="text/javascript">
    layui.use(['layer', 'table', 'form'], function () {
        let layer = layui.layer;
        let form = layui.form;
        let table = layui.table;

        let dateTable = table.render({
            elem: '#dataTable',
            url: "{{route('admin.auth.module.button.list')}}",
            where: {
                module_id: '{{$module->module_id}}'
            },
            page: true,
            cols: [
                [{
                    field: 'full_name',
                    title: '名称'
                }, {
                    field: 'encode',
                    title: '编号'
                }, {
                    field: 'action_url',
                    title: '地址'
                }, {
                    title: '操作',
                    fixed: 'right',
                    algin: 'center',
                    toolbar: '#options'
                }]
            ]
        });
    });

</script>
@endsection
